From 96a05c4ed25302544553c14fa2b4e170ff978252 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 21 Jan 2003 14:35:12 +0000 Subject: [PATCH] Add icon on input and output, bump name to 20 chars. --- gpsbabel/gpsdrive.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gpsbabel/gpsdrive.c b/gpsbabel/gpsdrive.c index 497bb52d9..64cb3a218 100644 --- a/gpsbabel/gpsdrive.c +++ b/gpsbabel/gpsdrive.c @@ -105,7 +105,10 @@ data_read(void) break; case 2: wpt_tmp->position.longitude.degrees = atof(s); - break; + break; + case 3: + wpt_tmp->icon_descr = xstrdup(s); + break; default: fprintf (stderr, "%s: Warning: unmapped data fields on line %d.\n", MYNAME, linecount); @@ -159,10 +162,16 @@ gpsdrive_waypt_pr(const waypoint *wpt) shortname = mkshort(mkshort_wr_handle, shortname); } - fprintf(file_out, "%s %08.5f %08.5f\n", + fprintf(file_out, "%s %08.5f %08.5f", shortname, lat, lon); + if (wpt->icon_descr) { + char *s = csv_stringclean(wpt->icon_descr, " "); + fprintf(file_out, " %s", s); + free(s); + } + fprintf(file_out, "\n"); if (shortname) free (shortname); @@ -173,7 +182,7 @@ static void data_write(void) { mkshort_wr_handle = mkshort_new_handle(); - setshort_length(mkshort_wr_handle, 10); + setshort_length(mkshort_wr_handle, 20); setshort_whitespace_ok(mkshort_wr_handle, 0); waypt_disp_all(gpsdrive_waypt_pr); -- 2.30.2